# 定义一个元组
#
# tuple1 = ()
# print(type(tuple1),tuple1)
#
#
# tuple2 = ('hello')
# print(type(tuple2),tuple2)
#
# #hello后要加一个, 不然打印出来是字符串
# tuple3 = ('hello',)
# print(type(tuple3),tuple3)


# 元组数据是不能修改的
# tuple = ('name','sex','age','tel',1,2,3,[7,8,9])

# tuple[1]='hello'
# print(tuple)     #报错 因为元组的数据无法修改


# tuple[7][1]='hello'
# print(tuple)     #元组里的列表数据可以被修改
#
#遍历元组
# for a in tuple:
#     print(a)
#
# for a in tuple:
#     for b in a:
#         print(b)
#数字是无法遍历的,但是字符串的数字可以遍历.


